<!DOCTYPE html>
<html lang="en">
<head>
    <title>请假列表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style>

        .lineOne{
            text-align: left;
        }
        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }
        .imgStyle{
            width: 300px;
            height: 400px;
        }
        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div class="oaLoad">
        <div class="loadGif" id="areaProgress"></div>
    </div>
    <div style="padding: 0 10px;background: #fff;overflow: hidden" id="signInBigRegion">
        <div  style="width: 100%;" class="mScrollBox">

            <table class="table table-bordered text-center table-width " >
                <thead>
                <tr>
                    <th style="width: 90px;"  class="tableTitle">岗位</th>
                    <th style="width: 90px;" class="tableTitle">姓名</th>
                    <th style="width: 120px;" class="tableTitle">请假日期</th>
                    <th class="tableTitle">请假原因</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(item,i) in sign.list">
                    <td :rowspan="item.roleNamespan" :class="{hidden: item.roleNamedis}">
                        {{item.roleName}}</td>
                    <td :rowspan="item.userNamespan" :class="{hidden: item.userNamedis}">
                        {{item.userName}}</td>
                    <td>{{(item.signDate).substr(5,10)}}</td>
                    <td class="lineOne" :rowspan="item.startAddressspan"
                        :class="{hidden: item.startAddressdis}">
                        <span>{{item.startAddress}}</span>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    <!-- /.box-body -->
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=0b5caf39"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=0c4d95a9"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            type1: $.wyui.page.urlParams.type1,
            type2: $.wyui.page.urlParams.type2,
            typeId:$.wyui.page.urlParams.typeId,
            dateTime: $.wyui.page.urlParams.dateTime?$.wyui.page.urlParams.dateTime:new Date().Format("yyyy-MM-dd"),
            today: new Date().Format("yyyy-MM-dd"),//今天
            hour:new Date().getHours(),
            thisMonth: new Date().Format("yyyy-MM"),
            thisWeek: new Date().Format("yyyy-MM-dd") + "-w",
            tab:[],
            sign: {
                list: [],
                info:{}
            },
        },
        methods: {
            //获取tab
            openImg:function (url) {
                top.$.dialog({
                    title: '图片详情',
                    content: 'url:/page/showImg.html?url=' + url,
                    height: 500,
                    max: true,
                    min: false,
                    lock: true
                }).max();
            },
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            //获取签到报表-区域经理
            get_signInList: function () {
                var that = this;
                var data={};
                if(that.type1=="company") {
                    data = {
                        "companyId": that.typeId,
                        "type": that.type2,
                        "dateTime":that.dateTime
                    }
                }else if(that.type1=="user"){
                    data={
                        "userId": that.typeId,
                        "type": that.type2,
                        "dateTime":that.dateTime
                    }
                }else{
                    data={
                        "departId": that.typeId,
                        "type": that.type2,
                        "dateTime":that.dateTime
                    }
                }
                if(that.type1=="user"){
                    $.wyui.postLoadMethod(urlConfig.report.attendance.getForManagerInByTypeAndMonthTime, data, function (data) {
                        console.log(data);
                        that.sign.list = that.tablesMergeCell(data);
                    }, false,true);
                }else{
                    $.wyui.postLoadMethod(urlConfig.report.attendance.getForSignInByTypeAndDateTime, data, function (data) {
                        console.log(data);
                        that.sign.list = that.tablesMergeCell(data);
                    }, false,true);
                }

            }
        },
        mounted: function () {
            var that = this;
            //1.获取前5个月的tab数据
            this.get_signInList();
        }
    });
</script>

</body>
</html>